import React, { PureComponent } from 'react'
import { View, Text, Image, ImageBackground, StyleSheet } from 'react-native'
import { connect } from 'react-redux'
import { width, unitWidth } from '../../../utils/AdapterUtil'
import { Button } from '../../../components'
import styles from '../styles'
import TitleBar from '../../../components/TitleBar'
import { createAction, NavigationActions, LANG, FN } from '../../../utils'
import images from '../../../assets/images'
@connect(({ app }) => ({ ...app }))
class Account extends PureComponent {
  static navigationOptions = {
    tabBarLabel: '我的',
    tabBarIcon: ({ focused, tintColor }) => (
      <Image
        style={[styles.icon, {
          tintColor: focused ? '#fff' : '#fff', //是否选择的时候图标的颜色 
        }]}
        source={images.tab.tab_user}
      />
    ),
  }

  gotoLogin = () => {
    this.props.dispatch(NavigationActions.navigate({ routeName: 'Login' }))
  }

  logout = () => {
    this.props.dispatch(createAction('app/logout')())
  }

  render() {
    const { navigation } = this.props
    return (
      <View style={styles.container}>
        <TitleBar
          title={LANG['我的'] || '我的'}
          navigation={navigation}
          hideLeftArrow
          backgroundColor='transparent'
        />
      </View>
    )
  }
}

export default Account
